
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/physics/mechanics/api/joint.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:27:35 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Joint (Docstrings) &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
    <script src="../../../../_static/jquery.js"></script>
    <script src="../../../../_static/underscore.js"></script>
    <script src="../../../../_static/doctools.js"></script>
    <script src="../../../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-sphinx.js"></script>
    
    <link rel="shortcut icon" href="../../../../_static/sympy-notailtext-favicon.ico"/>
    <link href="joint.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../../../genindex.html" />
    <link rel="search" title="Search" href="../../../../search.html" />
    <link rel="next" title="Quantum Mechanics" href="../../quantum/index.html" />
    <link rel="prev" title="Body (Docstrings)" href="body.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../../quantum/index.html" title="Quantum Mechanics"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="body.html" title="Body (Docstrings)"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="../index.html" accesskey="U">Classical Mechanics</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Joint (Docstrings)</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="module-sympy.physics.mechanics.joint">
<span id="joint-docstrings"></span><h1>Joint (Docstrings)<a class="headerlink" href="#module-sympy.physics.mechanics.joint" title="Permalink to this headline">¶</a></h1>
<section id="joint">
<h2>Joint<a class="headerlink" href="#joint" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.mechanics.joint.</span></span><span class="sig-name descname"><span class="pre">Joint</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">child</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">coordinates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">speeds</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent_joint_pos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">child_joint_pos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent_axis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">child_axis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/joint.py#L15-L309"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base class for all specific joints.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> : string</p>
<blockquote>
<div><p>A unique name for the joint.</p>
</div></blockquote>
<p><strong>parent</strong> : Body</p>
<blockquote>
<div><p>The parent body of joint.</p>
</div></blockquote>
<p><strong>child</strong> : Body</p>
<blockquote>
<div><p>The child body of joint.</p>
</div></blockquote>
<p><strong>coordinates: List of dynamicsymbols, optional</strong></p>
<blockquote>
<div><p>Generalized coordinates of the joint.</p>
</div></blockquote>
<p><strong>speeds</strong> : List of dynamicsymbols, optional</p>
<blockquote>
<div><p>Generalized speeds of joint.</p>
</div></blockquote>
<p><strong>parent_joint_pos</strong> : Vector, optional</p>
<blockquote>
<div><p>Vector from the parent body’s mass center to the point where the parent
and child are connected. The default value is the zero vector.</p>
</div></blockquote>
<p><strong>child_joint_pos</strong> : Vector, optional</p>
<blockquote>
<div><p>Vector from the child body’s mass center to the point where the parent
and child are connected. The default value is the zero vector.</p>
</div></blockquote>
<p><strong>parent_axis</strong> : Vector, optional</p>
<blockquote>
<div><p>Axis fixed in the parent body which aligns with an axis fixed in the
child body. The default is x axis in parent’s reference frame.</p>
</div></blockquote>
<p><strong>child_axis</strong> : Vector, optional</p>
<blockquote>
<div><p>Axis fixed in the child body which aligns with an axis fixed in the
parent body. The default is x axis in child’s reference frame.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>A joint subtracts degrees of freedom from a body. This is the base class
for all specific joints and holds all common methods acting as an interface
for all joints. Custom joint can be created by inheriting Joint class and
defining all abstract functions.</p>
<p>The abstract methods are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">_generate_coordinates</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">_generate_speeds</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">_orient_frames</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">_set_angular_velocity</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">_set_linar_velocity</span></code></p></li>
</ul>
<p class="rubric">Notes</p>
<p>The direction cosine matrix between the child and parent is formed using a
simple rotation about an axis that is normal to both <code class="docutils literal notranslate"><span class="pre">child_axis</span></code> and
<code class="docutils literal notranslate"><span class="pre">parent_axis</span></code>. In general, the normal axis is formed by crossing the
<code class="docutils literal notranslate"><span class="pre">child_axis</span></code> into the <code class="docutils literal notranslate"><span class="pre">parent_axis</span></code> except if the child and parent axes
are in exactly opposite directions. In that case the rotation vector is chosen
using the rules in the following table where <code class="docutils literal notranslate"><span class="pre">C</span></code> is the child reference
frame and <code class="docutils literal notranslate"><span class="pre">P</span></code> is the parent reference frame:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 33%" />
<col style="width: 33%" />
<col style="width: 33%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p><code class="docutils literal notranslate"><span class="pre">child_axis</span></code></p></th>
<th class="head"><p><code class="docutils literal notranslate"><span class="pre">parent_axis</span></code></p></th>
<th class="head"><p><code class="docutils literal notranslate"><span class="pre">rotation_axis</span></code></p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">-C.x</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.x</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.z</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">-C.y</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.y</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.x</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">-C.z</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.z</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.y</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">-C.x-C.y</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.x+P.y</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.z</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">-C.y-C.z</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.y+P.z</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.x</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">-C.x-C.z</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.x+P.z</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.y</span></code></p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">-C.x-C.y-C.z</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">P.x+P.y+P.z</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">(P.x+P.y+P.z)</span> <span class="pre">×</span> <span class="pre">P.x</span></code></p></td>
</tr>
</tbody>
</table>
<p class="rubric">Attributes</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 85%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p>name</p></td>
<td><p>(string) The joint’s name.</p></td>
</tr>
<tr class="row-even"><td><p>parent</p></td>
<td><p>(Body) The joint’s parent body.</p></td>
</tr>
<tr class="row-odd"><td><p>child</p></td>
<td><p>(Body) The joint’s child body.</p></td>
</tr>
<tr class="row-even"><td><p>coordinates</p></td>
<td><p>(list) List of the joint’s generalized coordinates.</p></td>
</tr>
<tr class="row-odd"><td><p>speeds</p></td>
<td><p>(list) List of the joint’s generalized speeds.</p></td>
</tr>
<tr class="row-even"><td><p>parent_point</p></td>
<td><p>(Point) The point fixed in the parent body that represents the joint.</p></td>
</tr>
<tr class="row-odd"><td><p>child_point</p></td>
<td><p>(Point) The point fixed in the child body that represents the joint.</p></td>
</tr>
<tr class="row-even"><td><p>parent_axis</p></td>
<td><p>(Vector) The axis fixed in the parent frame that represents the joint.</p></td>
</tr>
<tr class="row-odd"><td><p>child_axis</p></td>
<td><p>(Vector) The axis fixed in the child frame that represents the joint.</p></td>
</tr>
<tr class="row-even"><td><p>kdes</p></td>
<td><p>(list) Kinematical differential equations of the joint.</p></td>
</tr>
</tbody>
</table>
<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint.child">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">child</span></span><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint.child" title="Permalink to this definition">¶</a></dt>
<dd><p>Child body of Joint.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint.child_axis">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">child_axis</span></span><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint.child_axis" title="Permalink to this definition">¶</a></dt>
<dd><p>The axis of child frame.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint.child_point">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">child_point</span></span><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint.child_point" title="Permalink to this definition">¶</a></dt>
<dd><p>The joint’s point where child body is connected to the joint.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint.coordinates">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">coordinates</span></span><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint.coordinates" title="Permalink to this definition">¶</a></dt>
<dd><p>List generalized coordinates of the joint.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint.kdes">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">kdes</span></span><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint.kdes" title="Permalink to this definition">¶</a></dt>
<dd><p>Kinematical differential equations of the joint.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint.parent">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">parent</span></span><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>Parent body of Joint.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint.parent_axis">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">parent_axis</span></span><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint.parent_axis" title="Permalink to this definition">¶</a></dt>
<dd><p>The axis of parent frame.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint.parent_point">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">parent_point</span></span><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint.parent_point" title="Permalink to this definition">¶</a></dt>
<dd><p>The joint’s point where parent body is connected to the joint.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.Joint.speeds">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">speeds</span></span><a class="headerlink" href="#sympy.physics.mechanics.joint.Joint.speeds" title="Permalink to this definition">¶</a></dt>
<dd><p>List generalized coordinates of the joint..</p>
</dd></dl>

</dd></dl>

</section>
<section id="pinjoint">
<h2>PinJoint<a class="headerlink" href="#pinjoint" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.PinJoint">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.mechanics.joint.</span></span><span class="sig-name descname"><span class="pre">PinJoint</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">child</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">coordinates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">speeds</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent_joint_pos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">child_joint_pos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent_axis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">child_axis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/joint.py#L312-L532"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.joint.PinJoint" title="Permalink to this definition">¶</a></dt>
<dd><p>Pin (Revolute) Joint.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> : string</p>
<blockquote>
<div><p>A unique name for the joint.</p>
</div></blockquote>
<p><strong>parent</strong> : Body</p>
<blockquote>
<div><p>The parent body of joint.</p>
</div></blockquote>
<p><strong>child</strong> : Body</p>
<blockquote>
<div><p>The child body of joint.</p>
</div></blockquote>
<p><strong>coordinates: dynamicsymbol, optional</strong></p>
<blockquote>
<div><p>Generalized coordinates of the joint.</p>
</div></blockquote>
<p><strong>speeds</strong> : dynamicsymbol, optional</p>
<blockquote>
<div><p>Generalized speeds of joint.</p>
</div></blockquote>
<p><strong>parent_joint_pos</strong> : Vector, optional</p>
<blockquote>
<div><p>Vector from the parent body’s mass center to the point where the parent
and child are connected. The default value is the zero vector.</p>
</div></blockquote>
<p><strong>child_joint_pos</strong> : Vector, optional</p>
<blockquote>
<div><p>Vector from the child body’s mass center to the point where the parent
and child are connected. The default value is the zero vector.</p>
</div></blockquote>
<p><strong>parent_axis</strong> : Vector, optional</p>
<blockquote>
<div><p>Axis fixed in the parent body which aligns with an axis fixed in the
child body. The default is x axis in parent’s reference frame.</p>
</div></blockquote>
<p><strong>child_axis</strong> : Vector, optional</p>
<blockquote>
<div><p>Axis fixed in the child body which aligns with an axis fixed in the
parent body. The default is x axis in child’s reference frame.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>A pin joint is defined such that the joint rotation axis is fixed in both
the child and parent and the location of the joint is relative to the mass
center of each body. The child rotates an angle, θ, from the parent about
the rotation axis and has a simple angular speed, ω, relative to the
parent. The direction cosine matrix between the child and parent is formed
using a simple rotation about an axis that is normal to both <code class="docutils literal notranslate"><span class="pre">child_axis</span></code>
and <code class="docutils literal notranslate"><span class="pre">parent_axis</span></code>, see the Notes section for a detailed explanation of
this.</p>
<p class="rubric">Examples</p>
<p>A single pin joint is created from two bodies and has the following basic
attributes:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">PinJoint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">parent</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;P&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">parent</span>
<span class="go">P</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">child</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;C&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">child</span>
<span class="go">C</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span> <span class="o">=</span> <span class="n">PinJoint</span><span class="p">(</span><span class="s1">&#39;PC&#39;</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">child</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span>
<span class="go">PinJoint: PC  parent: P  child: C</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">name</span>
<span class="go">&#39;PC&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">parent</span>
<span class="go">P</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child</span>
<span class="go">C</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">parent_point</span>
<span class="go">PC_P_joint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child_point</span>
<span class="go">PC_C_joint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">parent_axis</span>
<span class="go">P_frame.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child_axis</span>
<span class="go">C_frame.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">coordinates</span>
<span class="go">[theta_PC(t)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">speeds</span>
<span class="go">[omega_PC(t)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">joint</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">omega_PC(t)*P_frame.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">joint</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1,                 0,                0],</span>
<span class="go">[0,  cos(theta_PC(t)), sin(theta_PC(t))],</span>
<span class="go">[0, -sin(theta_PC(t)), cos(theta_PC(t))]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child_point</span><span class="o">.</span><span class="n">pos_from</span><span class="p">(</span><span class="n">joint</span><span class="o">.</span><span class="n">parent_point</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<p>To further demonstrate the use of the pin joint, the kinematics of simple
double pendulum that rotates about the Z axis of each connected body can be
created as follows.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">trigsimp</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">PinJoint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">l1</span><span class="p">,</span> <span class="n">l2</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;l1 l2&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>First create bodies to represent the fixed ceiling and one to represent
each pendulum bob.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ceiling</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;C&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">upper_bob</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;U&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">lower_bob</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;L&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>The first joint will connect the upper bob to the ceiling by a distance of
<code class="docutils literal notranslate"><span class="pre">l1</span></code> and the joint axis will be about the Z axis for each body.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ceiling_joint</span> <span class="o">=</span> <span class="n">PinJoint</span><span class="p">(</span><span class="s1">&#39;P1&#39;</span><span class="p">,</span> <span class="n">ceiling</span><span class="p">,</span> <span class="n">upper_bob</span><span class="p">,</span>
<span class="gp">... </span><span class="n">child_joint_pos</span><span class="o">=-</span><span class="n">l1</span><span class="o">*</span><span class="n">upper_bob</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">x</span><span class="p">,</span>
<span class="gp">... </span><span class="n">parent_axis</span><span class="o">=</span><span class="n">ceiling</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">z</span><span class="p">,</span>
<span class="gp">... </span><span class="n">child_axis</span><span class="o">=</span><span class="n">upper_bob</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">z</span><span class="p">)</span>
</pre></div>
</div>
<p>The second joint will connect the lower bob to the upper bob by a distance
of <code class="docutils literal notranslate"><span class="pre">l2</span></code> and the joint axis will also be about the Z axis for each body.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pendulum_joint</span> <span class="o">=</span> <span class="n">PinJoint</span><span class="p">(</span><span class="s1">&#39;P2&#39;</span><span class="p">,</span> <span class="n">upper_bob</span><span class="p">,</span> <span class="n">lower_bob</span><span class="p">,</span>
<span class="gp">... </span><span class="n">child_joint_pos</span><span class="o">=-</span><span class="n">l2</span><span class="o">*</span><span class="n">lower_bob</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">x</span><span class="p">,</span>
<span class="gp">... </span><span class="n">parent_axis</span><span class="o">=</span><span class="n">upper_bob</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">z</span><span class="p">,</span>
<span class="gp">... </span><span class="n">child_axis</span><span class="o">=</span><span class="n">lower_bob</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">z</span><span class="p">)</span>
</pre></div>
</div>
<p>Once the joints are established the kinematics of the connected bodies can
be accessed. First the direction cosine matrices of pendulum link relative
to the ceiling are found:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">upper_bob</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">ceiling</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[ cos(theta_P1(t)), sin(theta_P1(t)), 0],</span>
<span class="go">[-sin(theta_P1(t)), cos(theta_P1(t)), 0],</span>
<span class="go">[                0,                0, 1]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">trigsimp</span><span class="p">(</span><span class="n">lower_bob</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">ceiling</span><span class="o">.</span><span class="n">frame</span><span class="p">))</span>
<span class="go">Matrix([</span>
<span class="go">[ cos(theta_P1(t) + theta_P2(t)), sin(theta_P1(t) + theta_P2(t)), 0],</span>
<span class="go">[-sin(theta_P1(t) + theta_P2(t)), cos(theta_P1(t) + theta_P2(t)), 0],</span>
<span class="go">[                              0,                              0, 1]])</span>
</pre></div>
</div>
<p>The position of the lower bob’s masscenter is found with:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">lower_bob</span><span class="o">.</span><span class="n">masscenter</span><span class="o">.</span><span class="n">pos_from</span><span class="p">(</span><span class="n">ceiling</span><span class="o">.</span><span class="n">masscenter</span><span class="p">)</span>
<span class="go">l1*U_frame.x + l2*L_frame.x</span>
</pre></div>
</div>
<p>The angular velocities of the two pendulum links can be computed with
respect to the ceiling.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">upper_bob</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">ceiling</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">omega_P1(t)*C_frame.z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">lower_bob</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">ceiling</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">omega_P1(t)*C_frame.z + omega_P2(t)*U_frame.z</span>
</pre></div>
</div>
<p>And finally, the linear velocities of the two pendulum bobs can be computed
with respect to the ceiling.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">upper_bob</span><span class="o">.</span><span class="n">masscenter</span><span class="o">.</span><span class="n">vel</span><span class="p">(</span><span class="n">ceiling</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">l1*omega_P1(t)*U_frame.y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">lower_bob</span><span class="o">.</span><span class="n">masscenter</span><span class="o">.</span><span class="n">vel</span><span class="p">(</span><span class="n">ceiling</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">l1*omega_P1(t)*U_frame.y + l2*(omega_P1(t) + omega_P2(t))*L_frame.y</span>
</pre></div>
</div>
<p class="rubric">Attributes</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 85%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p>name</p></td>
<td><p>(string) The joint’s name.</p></td>
</tr>
<tr class="row-even"><td><p>parent</p></td>
<td><p>(Body) The joint’s parent body.</p></td>
</tr>
<tr class="row-odd"><td><p>child</p></td>
<td><p>(Body) The joint’s child body.</p></td>
</tr>
<tr class="row-even"><td><p>coordinates</p></td>
<td><p>(list) List of the joint’s generalized coordinates.</p></td>
</tr>
<tr class="row-odd"><td><p>speeds</p></td>
<td><p>(list) List of the joint’s generalized speeds.</p></td>
</tr>
<tr class="row-even"><td><p>parent_point</p></td>
<td><p>(Point) The point fixed in the parent body that represents the joint.</p></td>
</tr>
<tr class="row-odd"><td><p>child_point</p></td>
<td><p>(Point) The point fixed in the child body that represents the joint.</p></td>
</tr>
<tr class="row-even"><td><p>parent_axis</p></td>
<td><p>(Vector) The axis fixed in the parent frame that represents the joint.</p></td>
</tr>
<tr class="row-odd"><td><p>child_axis</p></td>
<td><p>(Vector) The axis fixed in the child frame that represents the joint.</p></td>
</tr>
<tr class="row-even"><td><p>kdes</p></td>
<td><p>(list) Kinematical differential equations of the joint.</p></td>
</tr>
</tbody>
</table>
</dd></dl>

</section>
<section id="prismaticjoint">
<h2>PrismaticJoint<a class="headerlink" href="#prismaticjoint" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.mechanics.joint.PrismaticJoint">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.mechanics.joint.</span></span><span class="sig-name descname"><span class="pre">PrismaticJoint</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">child</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">coordinates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">speeds</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent_joint_pos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">child_joint_pos</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">parent_axis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">child_axis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/joint.py#L535-L747"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.joint.PrismaticJoint" title="Permalink to this definition">¶</a></dt>
<dd><p>Prismatic (Sliding) Joint.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> : string</p>
<blockquote>
<div><p>A unique name for the joint.</p>
</div></blockquote>
<p><strong>parent</strong> : Body</p>
<blockquote>
<div><p>The parent body of joint.</p>
</div></blockquote>
<p><strong>child</strong> : Body</p>
<blockquote>
<div><p>The child body of joint.</p>
</div></blockquote>
<p><strong>coordinates: dynamicsymbol, optional</strong></p>
<blockquote>
<div><p>Generalized coordinates of the joint.</p>
</div></blockquote>
<p><strong>speeds</strong> : dynamicsymbol, optional</p>
<blockquote>
<div><p>Generalized speeds of joint.</p>
</div></blockquote>
<p><strong>parent_joint_pos</strong> : Vector, optional</p>
<blockquote>
<div><p>Vector from the parent body’s mass center to the point where the parent
and child are connected. The default value is the zero vector.</p>
</div></blockquote>
<p><strong>child_joint_pos</strong> : Vector, optional</p>
<blockquote>
<div><p>Vector from the child body’s mass center to the point where the parent
and child are connected. The default value is the zero vector.</p>
</div></blockquote>
<p><strong>parent_axis</strong> : Vector, optional</p>
<blockquote>
<div><p>Axis fixed in the parent body which aligns with an axis fixed in the
child body. The default is x axis in parent’s reference frame.</p>
</div></blockquote>
<p><strong>child_axis</strong> : Vector, optional</p>
<blockquote>
<div><p>Axis fixed in the child body which aligns with an axis fixed in the
parent body. The default is x axis in child’s reference frame.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>It is defined such that the child body translates with respect to the parent
body along the body fixed parent axis. The location of the joint is defined
by two points in each body which coincides when the generalized coordinate is zero. The direction cosine matrix between
the child and parent is formed using a simple rotation about an axis that is normal to
both <code class="docutils literal notranslate"><span class="pre">child_axis</span></code> and <code class="docutils literal notranslate"><span class="pre">parent_axis</span></code>, see the Notes section for a detailed explanation of
this.</p>
<p class="rubric">Examples</p>
<p>A single prismatic joint is created from two bodies and has the following basic
attributes:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">PrismaticJoint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">parent</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;P&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">parent</span>
<span class="go">P</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">child</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;C&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">child</span>
<span class="go">C</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span> <span class="o">=</span> <span class="n">PrismaticJoint</span><span class="p">(</span><span class="s1">&#39;PC&#39;</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">child</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span>
<span class="go">PrismaticJoint: PC  parent: P  child: C</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">name</span>
<span class="go">&#39;PC&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">parent</span>
<span class="go">P</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child</span>
<span class="go">C</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">parent_point</span>
<span class="go">PC_P_joint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child_point</span>
<span class="go">PC_C_joint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">parent_axis</span>
<span class="go">P_frame.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child_axis</span>
<span class="go">C_frame.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">coordinates</span>
<span class="go">[x_PC(t)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">speeds</span>
<span class="go">[v_PC(t)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">joint</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">joint</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0, 0],</span>
<span class="go">[0, 1, 0],</span>
<span class="go">[0, 0, 1]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">joint</span><span class="o">.</span><span class="n">child_point</span><span class="o">.</span><span class="n">pos_from</span><span class="p">(</span><span class="n">joint</span><span class="o">.</span><span class="n">parent_point</span><span class="p">)</span>
<span class="go">x_PC(t)*P_frame.x</span>
</pre></div>
</div>
<p>To further demonstrate the use of the prismatic joint, the kinematics of
two masses sliding, one moving relative to a fixed body and the other relative to the
moving body. about the X axis of each connected body can be created as follows.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">PrismaticJoint</span><span class="p">,</span> <span class="n">Body</span>
</pre></div>
</div>
<p>First create bodies to represent the fixed ceiling and one to represent
a particle.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">wall</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;W&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Part1</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;P1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Part2</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;P2&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>The first joint will connect the particle to the ceiling and the
joint axis will be about the X axis for each body.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">J1</span> <span class="o">=</span> <span class="n">PrismaticJoint</span><span class="p">(</span><span class="s1">&#39;J1&#39;</span><span class="p">,</span> <span class="n">wall</span><span class="p">,</span> <span class="n">Part1</span><span class="p">)</span>
</pre></div>
</div>
<p>The second joint will connect the second particle to the first particle
and the joint axis will also be about the X axis for each body.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">J2</span> <span class="o">=</span> <span class="n">PrismaticJoint</span><span class="p">(</span><span class="s1">&#39;J2&#39;</span><span class="p">,</span> <span class="n">Part1</span><span class="p">,</span> <span class="n">Part2</span><span class="p">)</span>
</pre></div>
</div>
<p>Once the joint is established the kinematics of the connected bodies can
be accessed. First the direction cosine matrices of Part relative
to the ceiling are found:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Part1</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">wall</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0, 0],</span>
<span class="go">[0, 1, 0],</span>
<span class="go">[0, 0, 1]])</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Part2</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">wall</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1, 0, 0],</span>
<span class="go">[0, 1, 0],</span>
<span class="go">[0, 0, 1]])</span>
</pre></div>
</div>
<p>The position of the particles’ masscenter is found with:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Part1</span><span class="o">.</span><span class="n">masscenter</span><span class="o">.</span><span class="n">pos_from</span><span class="p">(</span><span class="n">wall</span><span class="o">.</span><span class="n">masscenter</span><span class="p">)</span>
<span class="go">x_J1(t)*W_frame.x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Part2</span><span class="o">.</span><span class="n">masscenter</span><span class="o">.</span><span class="n">pos_from</span><span class="p">(</span><span class="n">wall</span><span class="o">.</span><span class="n">masscenter</span><span class="p">)</span>
<span class="go">x_J1(t)*W_frame.x + x_J2(t)*P1_frame.x</span>
</pre></div>
</div>
<p>The angular velocities of the two particle links can be computed with
respect to the ceiling.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Part1</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">wall</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Part2</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">wall</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<p>And finally, the linear velocities of the two particles can be computed
with respect to the ceiling.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Part1</span><span class="o">.</span><span class="n">masscenter_vel</span><span class="p">(</span><span class="n">wall</span><span class="p">)</span>
<span class="go">v_J1(t)*W_frame.x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Part2</span><span class="o">.</span><span class="n">masscenter</span><span class="o">.</span><span class="n">vel</span><span class="p">(</span><span class="n">wall</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">v_J1(t)*W_frame.x + v_J2(t)*P1_frame.x</span>
</pre></div>
</div>
<p class="rubric">Attributes</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 85%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p>name</p></td>
<td><p>(string) The joint’s name.</p></td>
</tr>
<tr class="row-even"><td><p>parent</p></td>
<td><p>(Body) The joint’s parent body.</p></td>
</tr>
<tr class="row-odd"><td><p>child</p></td>
<td><p>(Body) The joint’s child body.</p></td>
</tr>
<tr class="row-even"><td><p>coordinates</p></td>
<td><p>(list) List of the joint’s generalized coordinates.</p></td>
</tr>
<tr class="row-odd"><td><p>speeds</p></td>
<td><p>(list) List of the joint’s generalized speeds.</p></td>
</tr>
<tr class="row-even"><td><p>parent_point</p></td>
<td><p>(Point) The point fixed in the parent body that represents the joint.</p></td>
</tr>
<tr class="row-odd"><td><p>child_point</p></td>
<td><p>(Point) The point fixed in the child body that represents the joint.</p></td>
</tr>
<tr class="row-even"><td><p>parent_axis</p></td>
<td><p>(Vector) The axis fixed in the parent frame that represents the joint.</p></td>
</tr>
<tr class="row-odd"><td><p>child_axis</p></td>
<td><p>(Vector) The axis fixed in the child frame that represents the joint.</p></td>
</tr>
<tr class="row-even"><td><p>kdes</p></td>
<td><p>(list) Kinematical differential equations of the joint.</p></td>
</tr>
</tbody>
</table>
</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../../../index.html">
              <img class="logo" src="../../../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Joint (Docstrings)</a><ul>
<li><a class="reference internal" href="#joint">Joint</a></li>
<li><a class="reference internal" href="#pinjoint">PinJoint</a></li>
<li><a class="reference internal" href="#prismaticjoint">PrismaticJoint</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="body.html"
                        title="previous chapter">Body (Docstrings)</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../../quantum/index.html"
                        title="next chapter">Quantum Mechanics</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../../_sources/modules/physics/mechanics/api/joint.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../../quantum/index.html" title="Quantum Mechanics"
             >next</a> |</li>
        <li class="right" >
          <a href="body.html" title="Body (Docstrings)"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="../index.html" >Classical Mechanics</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Joint (Docstrings)</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/physics/mechanics/api/joint.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:27:35 GMT -->
</html>